<?php TPL::output('global/header.tpl.htm'); ?>
<div class="aw-container-wrap aw-work-wrap">
    <?php TPL::output('block/content_nav_menu.tpl.htm'); ?>

    <div class="container">
        <div class="row">
            <div class="aw-content-wrap clearfix">
                <!-- 侧边栏 -->
                <div class="col-sm-12 col-md-3 aw-side-bar hidden-xs hidden-sm">
                    <div class="aw-mod side-nav">
                        <h2><i class="icon icon-order"></i><?php _e('工单'); ?></h2>
                        <ul>
                            <?php if ($this->user_info['permission']['is_service']) { ?>
                            <li>
                                <a href="ticket/service-me__status-pending"><?php _e('我的待处理工单'); ?><span class="badge"><?php echo $this->my_pending_tickets; ?></span></a>
                            </li>
                            <?php } ?>
                            <li>
                                <a href="ticket/service-0__status-pending"><?php _e('未分配工单'); ?></a>
                            </li>
                            <li>
                                <a href="ticket/status-pending"><?php _e('所有待处理工单'); ?></a>
                            </li>
                            <li>
                                <a href="ticket/"><?php _e('所有工单'); ?></a>
                            </li>
                        </ul>
                    </div>

                    <?php if ($this->user_info['permission']['is_administortar']) { ?>
                    <div class="aw-mod side-nav">
                        <h2><i class="icon icon-count"></i><?php _e('统计分析'); ?></h2>
                        <ul>
                            <li>
                                <a href="ticket/data/"><?php _e('综合数据表'); ?></a>
                            </li>
                            <li>
                                <a href="ticket/work_data/"><?php _e('业绩报表'); ?></a>
                            </li>
                            <li>
                                <a href="ticket/topic/" class="active"><?php _e('热门话题'); ?></a>
                            </li>
                        </ul>
                    </div>

                    <div class="aw-mod side-nav">
                        <h2><i class="icon icon-job"></i><?php _e('管理中心'); ?></h2>
                        <ul>
                            <li>
                                <a href="ticket/channel/"><?php _e('渠道管理'); ?></a>
                            </li>
                            <li>
                                <a href="admin/ticket/service_group_list/" target="_blank"><?php _e('客服组管理'); ?></a>
                            </li>
                        </ul>
                    </div>
                    <?php } ?>
                </div>
                <!-- end 侧边栏 -->

                <div class="col-sm-12 col-md-9 aw-main-content">
                    <div class="aw-mod aw-topic-list">
                        <div class="mod-head">
                            <ul class="nav nav-tabs aw-nav-tabs active hidden-xs">
                                <li><a href="ticket/topic/days-30"<?php if ($_GET['days'] == '30') { ?> class="active"<?php } ?>><?php _e('%s 天', '30'); ?></a></li>
                                <li><a href="ticket/topic/days-7"<?php if ($_GET['days'] == '7') { ?> class="active"<?php } ?>><?php _e('%s 天', '7'); ?></a></li>
                                <li><a href="ticket/topic/"<?php if (!$_GET['days']) { ?> class="active"<?php } ?>><?php _e('全部'); ?></a></li>
                                <h2>
                                    <i class="icon icon-count"></i> <?php _e('热门话题'); ?>
                                </h2>
                            </ul>
                        </div>

                        <div class="mod-body clearfix">
                            <?php if ($this->topics_list) {
                                foreach ($this->topics_list AS $topic_info) { ?>
                            <div class="aw-item">
                                <!-- 话题图片 -->
                                <a data-id="<?php echo $topic_info['topic_id']; ?>" href="topic/<?php echo $topic_info['topic_id']; ?>" class="img aw-border-radius-5">
                                    <img alt="" src="<?php echo get_topic_pic_url('mid', $topic_info['topic_pic']); ?>">
                                </a>
                                <!-- end 话题图片 -->
                                <p class="clearfix">
                                    <!-- 话题内容 -->
                                    <span class="topic-tag">
                                        <a data-id="<?php echo $topic_info['topic_id']; ?>" href="topic/<?php echo $topic_info['topic_id']; ?>" class="text"><?php _e($topic_info['topic_title']); ?></a>
                                    </span>
                                    <!-- end 话题内容 -->
                                </p>
                                <p class="text-color-999">
                                    <?php if ($_GET['days']) { if ($_GET['days'] == '30') _e('本月有'); else if ($_GET['days'] == '7') _e('本周有'); } else _e('共有'); ?>
                                    <?php _e('<b>%s</b> 个相关工单', $topic_info['tickets_count']); ?> • <?php _e('<b>%s</b> 个已解决', $topic_info['closed_tickets_count']); ?> • <?php _e('<b>%s</b> 个处理中', $topic_info['pending_tickets_count']); ?> • <?php _e('<b>%s</b> 个未分配', $topic_info['unassigned_tickets_count']); ?>
                                </p>
                            </div>
                            <?php }
                            } ?>
                        </div>

                        <div class="mod-footer clearfix">
                            <?php if ($this->pagination) echo $this->pagination; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php TPL::output('global/footer.tpl.htm'); ?>